#include "enemy.h"
#include "config.h"
enemy::enemy()
{
    m_enemy.load(":/picture/images/enemy1.png");
    m_x=0;
    m_y=0;
    m_free=true;
    m_speed=ENEMY_SPEED;
    m_Rect.setWidth(m_enemy.width());
    m_Rect.setHeight(m_enemy.height());
    m_Rect.moveTo(m_x,m_y);
}

void enemy::updatePosition()
{
    if(m_free){return;}
    m_y+=m_speed;
    m_Rect.moveTo(m_x,m_y);
    if(m_y>=GAME_HEIGHT+m_Rect.height())
    {
        m_free=true;
    }
}
